package mysql

import "gorm.io/gorm"

// 用户表
type User struct {
	gorm.Model
	Account  string `gorm:"type:varchar(30)"json:"account"`
	Password string `gorm:"type:varchar(35)"json:"Password"`
	Image    string `gorm:"type:varchar(500)"json:"image"`
	NickName string `gorm:"type:varchar(30)"json:"nickName"`
}

// 小说表
type Book struct {
	gorm.Model
	UserId int64  `gorm:"type:int"json:"userId"`
	Title  string `gorm:"type:varchar(30)"json:"title"`
	Types  string `gorm:"type:varchar(30)"json:"types"`
	Label  string `gorm:"type:varchar(30)"json:"label"`
	Text   string `gorm:"type:varchar(500)"json:"text"`
}

// 收藏小说表
type Collect struct {
	gorm.Model
	UserId      int64  `gorm:"type:int"json:"userId"`
	BookId      int64  `gorm:"type:int"json:"bookId"`
	CollectName string `gorm:"type:varchar(500)"json:"collectName"`
}

// 评论表
type Comment struct {
	gorm.Model
	UserId  int64  `gorm:"type:int"json:"userId"`
	BookId  int64  `gorm:"type:int"json:"bookId"`
	ConText string `gorm:"type:varchar(500)"json:"conText"`
}

// 书本列表
type BookList struct {
	Book
	Image    string `gorm:"type:varchar(500)"json:"image"`
	NickName string `gorm:"type:varchar(30)"json:"nickName"`
}

type CommentList struct {
	Comment
	NickName string `gorm:"type:varchar(30)"json:"nickName"`
	Title    string `gorm:"type:varchar(30)"json:"title"`
	Text     string `gorm:"type:varchar(500)"json:"text"`
}
